addView

open fun addView(view: View)

Adds a child view to the internal LinearLayout. The view is added with default LinearLayout.LayoutParams. If the internal LinearLayout (layout) is null, this method does nothing, and an error may be logged internally (though not explicitly shown here).

Parameters

view

The child view to add. Must not be null. If the view already has a parent, it must be removed before calling this method.


open fun addView(view: View, width: Int, height: Int)

Adds a child view to the internal LinearLayout with specified width and height.

If the internal LinearLayout (named layout) is available, this method creates LinearLayout.LayoutParams with the provided width and height and adds the view to the layout using these parameters.

If layout is null, the view will not be added, and a warning should be considered (though current implementation does not log).

Parameters

view

The child View to add.

width

The width for the child view, used to create LinearLayout.LayoutParams. This can be a fixed pixel value, MATCH_PARENT, or WRAP_CONTENT.

height

The height for the child view, used to create LinearLayout.LayoutParams. This can be a fixed pixel value, MATCH_PARENT, or WRAP_CONTENT.